<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
  <input type="text" placeholder="商品名" v-model="product.title">
  <input type="text" placeholder="价格"   v-model="product.price">
  <input type="text" placeholder="销量"   v-model="product.saleCount">
    <input type="button" value="提交" @click="insert()">
</div>
<script src="js/vue.js"></script>
<script src="js/axios.min.js"></script>
<script>
let v = new Vue({
    el:"div",
    data:{
        product:{
            title:"",price:"",saleCount:""
        }
    },
    methods:{
        insert(){
           axios.post("/insert",v.product).then(function (r) {

               alert("添加成功")
               location.href="/";
           })
        }
    }
})
</script>
</body>
</html>